<%@ include file="header.jsp" %>
<%@ page import="Model.Matchmaking.Newsletter" %>
<%@ page import="Model.Notification" %>
		<% 
			User user = new User(userID, false);
			PersonalInfo info = new PersonalInfo(userID);
		%>
		
		<form action="/UBCDatingServer/editprofile" method="post">
	        <input type="hidden" name="userID" value="<%=userID%>"/>
	        <p class="nomt"><strong>Name:</strong><br />
	        <input type="text" size="30" class="input" name="name" value="<%=user.getName() %>" /></p>
	        <p><strong>Address:</strong><br />
	        <input type="text" size="30" class="input" name="address" value="<%=info.getAddress() %>" /></p>
	        <p><strong>Gender:</strong><br />
	        Male:<input type="radio" class="input" name="gender" value="1" <%if (info.getGender()==1) {%> checked<%} %>/>
	        Female:<input type="radio" class="input" name="gender" value="2" <%if (info.getGender()==2) {%> checked<%} %>/></p>
	        <p><strong>Height:</strong><br />
	        <input type="text" size="1" maxlength="3" class="input" name="height" value="<%=info.getHeight() %>"/>cms</p>
	        <p><strong>Weight:</strong><br />
	        <input type="text" size="1" maxlength="3" class="input" name="weight" value="<%=info.getWeight() %>"/>lbs</p>
	        <%
	        String years="",months="",dates="";
			if (info.getBirthdate()!=null){
		        int year = info.getBirthdate().getYear();
		        years += year;
	        	int month = (info.getBirthdate().getMonth()+1);
	        	if (month < 10)
	        		months = "0"+month;
	        	else
	        		months = String.valueOf(month);
	        	int date = (info.getBirthdate().getDate());
	        	if (date < 10)
	        		dates = "0"+date;
	        	else
	        		dates = String.valueOf(date);
			}
	        %>
	        <p><strong>Birthday (YY/MM/DD):</strong><br />
	        <input type="text" size="1" maxlength="2" class="input" name="year" value="<%=years %>"/>/
	        <input type="text" size="1" maxlength="2" class="input" name="month" value="<%=months %>"/>/
	        <input type="text" size="1" maxlength="2" class="input" name="date" value="<%=dates %>"/></p>
	        <p><strong>Interests:</strong><br />
	        <table>
			<tr>
			<%String interest; %>
			
			<td><input type="checkbox" name="interests" <%interest = "Swimming"; %>value="<%=interest%>" <%if(info.getInterests().contains(interest)){ %>checked<%} %>/> swimming</td>
			<td><input type="checkbox" name="interests" <%interest = "Running"; %>value="<%=interest%>" <%if(info.getInterests().contains(interest)){ %>checked<%} %>/> running</td>
			<td><input type="checkbox" name="interests" <%interest = "Movies"; %>value="<%=interest%>" <%if(info.getInterests().contains(interest)){ %>checked<%} %>/> watching movies</td>
			</tr>
			<tr>
			<td><input type="checkbox" name="interests" <%interest = "Skating"; %>value="<%=interest%>" <%if(info.getInterests().contains(interest)){ %>checked<%} %>/> skating</td>
			<td><input type="checkbox" name="interests" <%interest = "Skiing"; %>value="<%=interest%>" <%if(info.getInterests().contains(interest)){ %>checked<%} %>/> skiing/boarding</td>
			<td><input type="checkbox" name="interests" <%interest = "Reading"; %>value="<%=interest%>" <%if(info.getInterests().contains(interest)){ %>checked<%} %>/> reading</td>
			</tr>
			<tr>
			<td><input type="checkbox" name="interests" <%interest = "Hiking"; %>value="<%=interest%>" <%if(info.getInterests().contains(interest)){ %>checked<%} %>/> hiking</td>
			<td><input type="checkbox" name="interests" <%interest = "Drinking"; %>value="<%=interest%>" <%if(info.getInterests().contains(interest)){ %>checked<%} %>/> drinking</td>
			<td><input type="checkbox" name="interests" <%interest = "Eating"; %>value="<%=interest%>" <%if(info.getInterests().contains(interest)){ %>checked<%} %>/> eating</td>
			</tr>
			<tr>
			<td><input type="checkbox" name="interests" <%interest = "Play Music"; %>value="<%=interest%>" <%if(info.getInterests().contains(interest)){ %>checked<%} %>/> playing music</td>
			<td><input type="checkbox" name="interests" <%interest = "Listen to Music"; %>value="<%=interest%>" <%if(info.getInterests().contains(interest)){ %>checked<%} %>/> listening to music</td>
			<td><input type="checkbox" name="interests" <%interest = "Travelling"; %>value="<%=interest%>" <%if(info.getInterests().contains(interest)){ %>checked<%} %>/> travelling</td>
			</tr>
			<tr>
			<td><input type="checkbox" name="interests" <%interest = "Video"; %>value="<%=interest%>" <%if(info.getInterests().contains(interest)){ %>checked<%} %>/> video games</td>
			<td><input type="checkbox" name="interests" <%interest = "Board"; %>value="<%=interest%>" <%if(info.getInterests().contains(interest)){ %>checked<%} %>/> board games</td>
			<td><input type="checkbox" name="interests" <%interest = "Religion"; %>value="<%=interest%>" <%if(info.getInterests().contains(interest)){ %>checked<%} %>/> religion</td>
			</tr>
			</table>
	        <p><strong>Sexual Orientation:</strong><br />
	        Likes males:<input type="radio" class="input" name="orientation" value="1" <%if (info.getOrientation()==1) {%> checked<%} %>/><br />
	        Likes females:<input type="radio" class="input" name="orientation" value="2" <%if (info.getOrientation()==2) {%> checked<%} %>/></p>
	        <p><strong>Religion:</strong><br />
<%-- 	        <input type="text" size="30" class="input" name="religion" <%if (info.getReligion()!=null){ %>value="<%= info.getReligion() %>"<%} %>/></p> --%>
<select name="religion">
							<option value="christian">Christian</option>
							<option value="muslim">Muslim</option>
							<option value="hindu">Hindu</option>
							<option value="buddhist">Buddhist</option>
							<option value="atheist">Atheist</option>
							<option value="agnostic">Agnostic</option>
							<option value="nopref">No preference</option>
					</select><br />
<!-- 	        <p><strong>Ethnicity:</strong><br /> -->
	<select name="ethnicity">
							<option value="Asian">Asian</option>
							<option value="African">African</option>
							<option value="European">European</option>
							<option value="Doesn't matter">Rather not say</option>
					</select><br />
<!-- 	        <p><strong>Ethnicity:</strong><br /> -->
<%-- 	        <input type="text" size="30" class="input" name="ethnicity" <%if (info.getEthnicity()!=null){ %>value="<%= info.getEthnicity() %>"<%} %>/></p><br /><br /> --%>
<%System.out.println("profile:"+Newsletter.getNewsletterFlag(userID));
System.out.println(Notification.getNotificationFlag(userID));%>
	        Get your match notifications:<br />
	        daily:<input type="radio" class="input" name="newsletter" value="2" <%if (Newsletter.getNewsletterFlag(userID)==2) {%> checked<%} %>/>
	        weekly:<input type="radio" class="input" name="newsletter" value="1" <%if (Newsletter.getNewsletterFlag(userID)==1) {%> checked<%} %>/>
	        never:<input type="radio" class="input" name="newsletter" value="0" <%if (Newsletter.getNewsletterFlag(userID)==0) {%> checked<%} %>/><br />
	        Get email notifications:
	        yes:<input type="radio" class="input" name="notification" value="1" <%if (Notification.getNotificationFlag(userID)==1) {%> checked<%} %>/>
	        no:<input type="radio" class="input" name="notification" value="0" <%if (Notification.getNotificationFlag(userID)==0) {%> checked<%} %>/><br />
	        
	        <p class="nomb"><input type="submit" value="Update" class="input-submit"/></p>
        </form>
        <a href="questionnaire.jsp">Click here to take the Questionnaire again!</a><span>|</span>
<%@ include file="footer.jsp"%>